
Page({
  data: {
    inputValue: 'abc',
    result: []
  },
  inputHandler(e) {
    this.setData({
      inputValue: e.detail.value
    })
  },
  searchHandler() {
    // console.log(this.data.inputValue)
    wx.request({
      url: 'http://rap2api.taobao.org/app/mock/224284/api/v1/pet/search',
      data: { title: this.data.inputValue },
      success: res => {
        console.log(res)
        this.setData({
          result: res.data.data.list
        })
      }
    })
  }
})